import request from '@/utils/request'

// 查询公告列表
export function listNotice(query) {
  return request({
    url: '/sys/logi/notice/list',
    method: 'get',
    params: query
  })
}

// 查询公告详细
export function getNotice(data) {
  return request({
    url: '/im/SysStationMessagePublish/' + data.id,
    data
  })
}

// 新增公告
export function addNotice(data) {
  return request({
    url: '/im/SysStationMessagePublish/add',
    method: 'post',
    data
  })
}

// 修改公告
export function updateNotice(data) {
  return request({
    url: '/im/SysStationMessagePublish/edit',
    method: 'put',
    data: data
  })
}

// 删除公告
export function delNotice(data) {
  return request({
    url: '/im/SysStationMessagePublish/' + data.ids,
    method: 'delete',
    data
  })
}

// 发布公告
export const releaseNotice = data => {
  return request({
    url: `/im/SysStationMessagePublish/${data.id}/publish`,
    method: 'patch',
    data
  })
}
